package com.hl.mapper;

import com.hl.pojo.Ceping;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CepingMapper {

    @Insert("insert into ceping (url, type) value (#{url},#{type})")
    public Integer add(Ceping ceping);

    @Delete("delete from ceping where id = #{id}")
    public Integer del(Ceping ceping);

    @Select("select c.*,count(c.id) sum from ceping c join timu t on c.id = t.cp_id group by c.id;")
    public List<Ceping> findAll();


}
